package org.iris.plugin.model

import org.iris.plugin.config.HitHitConfig


enum class Action(value: String){
    NONE("无"),
    HIT("锤"),
    PAT("摸"),
    TIETIE("贴贴"),
    FUCK("艹"),
    KICK("踢"),
    PIA("打"),
    HUG("抱抱"),
    TRAMPLE("踩")
}

val ENABLE_MAP = mapOf(
    Action.HIT to HitHitConfig.HitOn,
    Action.PAT to HitHitConfig.PatOn,
    Action.TIETIE to HitHitConfig.TieOn,
    Action.FUCK to HitHitConfig.FuckOn,
    Action.KICK to HitHitConfig.KickOn,
    Action.PIA to HitHitConfig.PiaOn,
    Action.HUG to HitHitConfig.HugOn,
    Action.TRAMPLE to HitHitConfig.TrampleOn
)

val WORD_MAP = mapOf(
    Action.HIT to HitHitConfig.HitWords,
    Action.PAT to HitHitConfig.PatWords,
    Action.TIETIE to HitHitConfig.TieWords,
    Action.FUCK to HitHitConfig.FuckWords,
    Action.KICK to HitHitConfig.KickWords,
    Action.PIA to HitHitConfig.PiaWords,
    Action.HUG to HitHitConfig.HugWords,
    Action.TRAMPLE to HitHitConfig.TrampleWords
)

// 背景图片
val IMAGE_MAP = mapOf<Action, String>(
    Action.HIT to "hit_.jpg",
    Action.PAT to "pat_.png",
    Action.TIETIE to "tie_.jpg",
    Action.FUCK to "fuck_.jpg",
    Action.KICK to "kick_.png",
    Action.PIA to "pia_.jpg",
    Action.HUG to "hug_.jpg",
    Action.TRAMPLE to "trample_.jpg"
)

// 延迟
val DELAY_MAP = mapOf(
    Action.HIT to 100,
    Action.PAT to 40,
    Action.TIETIE to 40,
    Action.FUCK to 40,
    Action.KICK to 40,
    Action.PIA to 40,
    Action.HUG to 40,
    Action.TRAMPLE to 60,
)

// 是否双人互动
val INTERACT_MAP = mapOf(
    Action.HIT to true,
    Action.PAT to false,
    Action.TIETIE to true,
    Action.FUCK to true,
    Action.KICK to true,
    Action.PIA to true,
    Action.HUG to true,
    Action.TRAMPLE to true
)

// 头像是否在背景下
val UNDERBG_MAP = mapOf(
    Action.HIT to false,
    Action.PAT to true,
    Action.TIETIE to false,
    Action.FUCK to false,
    Action.KICK to false,
    Action.PIA to false,
    Action.HUG to false,
    Action.TRAMPLE to false
)

/// 用于记录不同表情每帧头像的位置
/// 从左至右分别为 头像1x y w h 头像2x y w h
val POS_MAP = mapOf<Action, List<List<Int>>>(
    Action.HIT to listOf(
        listOf(147, 78, 75, 75, 25, 143, 50, 50),
        listOf(147, 78, 75, 75, 26, 165, 50, 30)
    ),
    Action.PAT to listOf(
        listOf(12, 16, 100, 100, 0, 0, 0 ,0),
        listOf(12, 28, 105,  88, 0, 0, 0 ,0),
        listOf(12, 40, 110,  76, 0, 0, 0 ,0),
        listOf(12, 32, 107,  84, 0, 0, 0 ,0),
        listOf(12, 16, 100, 100, 0, 0, 0 ,0)
    ),
    Action.TIETIE to listOf(
        listOf(88, 53, 80, 84, 25, 59, 80, 84),
        listOf(90, 52, 82, 84, 26, 60, 82, 84),
        listOf(92, 53, 84, 84, 26, 61, 84, 84),
        listOf(90, 52, 82, 84, 26, 60, 82, 84),
        listOf(88, 53, 80, 84, 25, 59, 80, 84),
        listOf(88, 54, 80, 84, 25, 58, 80, 84),
        listOf(88, 53, 80, 84, 25, 59, 80, 84),
        listOf(90, 52, 82, 84, 26, 60, 82, 84),
        listOf(92, 53, 84, 84, 26, 61, 84, 84),
        listOf(90, 52, 82, 84, 26, 60, 82, 84),
        listOf(88, 53, 80, 84, 25, 59, 80, 84),
        listOf(88, 54, 80, 84, 25, 58, 80, 84)
    ),

    Action.FUCK to listOf(
        // 小企鹅冲击
//        listOf(66, 7, 27, 27, 18, 57, 24, 24),
//        listOf(66, 7, 27, 27, 41, 57, 24, 24)

        listOf(76, 51, 71, 71, 10, 27, 54, 54),
        listOf(74, 51, 71, 71, 8, 27, 54, 54)
    ),

    Action.KICK to listOf(
        listOf(149, 22, 55, 55, 30, 14, 55, 55),
        listOf(147, 20, 55, 55, 32, 14, 55, 55),
        listOf(145, 20, 55, 55, 30, 14, 55, 55),
        listOf(147, 19, 55, 55, 32, 14, 55, 55),
        listOf(145, 20, 55, 55, 30, 14, 55, 55),
        listOf(147, 19, 55, 55, 32, 14, 55, 55),
        listOf(145, 20, 55, 55, 30, 14, 55, 55),
        listOf(147, 19, 55, 55, 32, 14, 55, 55),
        listOf(145, 20, 55, 55, 30, 14, 55, 55),
        listOf(147, 19, 55, 55, 32, 14, 55, 55),
        listOf(145, 18, 55, 55, 30, 14, 55, 55),
        listOf(140,  9, 55, 55, 30, 14, 55, 55)
    ),

    Action.PIA to listOf(
        listOf(27, 63, 78, 78, 129, 114, 54, 54),
        listOf(24, 63, 78, 78, 150, 141, 54, 54),
        listOf(27, 63, 78, 78, 138, 126, 54, 54)
    ),


    Action.HUG to listOf(
        listOf(76, 28, 144, 144, 16, 28, 144, 144),
        listOf(76, 28, 144, 144, 16, 28, 144, 144),
        listOf(76, 28, 144, 144, 16, 28, 144, 144),
        listOf(76, 28, 144, 144, 16, 28, 144, 144),
        listOf(76, 28, 144, 144, 16, 28, 144, 144)
    ),

    Action.TRAMPLE to listOf(
        listOf(95, 47, 106, 106, 75, 201, 24, 24),
        listOf(89, 53, 106, 106, 81, 197, 24, 24)
    )
)